package com.corechina.apex_osswords.domain.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.corechina.apex_osswords.domain.entity.CoreClientele;
import com.corechina.apex_osswords.domain.vo.CoreClienteleVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 客户信息表 Mapper 接口
 * </p>
 *
 * @author cc
 * @since 2022-03-11
 */
@Component
public interface CoreClienteleMapper extends BaseMapper<CoreClientele> {

    IPage<CoreClienteleVo> getList(Page page, @Param("name") String name, @Param("company") String company);

    @Select("        select" +
            "            cc.id," +
            "            cc.company," +
            "            cc.name," +
            "            cc.tel," +
            "            cc.head_portrait headPortrait," +
            "            cc.forbidden" +
            "        from" +
            "        core_clientele cc" +
            " where cc.id = #{id}"
    )
    CoreClienteleVo getOne(@Param("id") Integer id);

}
